import {RC} from "../config/RC";
import operateResult from "./OperateArgs";
import OperateArgs from "./OperateArgs";

abstract class Operator{
    protected args : OperateArgs;

    // 构造函数签名
    constructor();
    constructor(args: OperateArgs);
    constructor(args?: OperateArgs) {
        if (args) {
            this.args = args;
        } else {
            this.args = new OperateArgs();
        }
    }
    public abstract execute() : Promise<RC>;

    public getOperateArgs(): OperateArgs{
        return this.args
    }

    public setOperateArgs(operateArgs: OperateArgs){
        this.args = operateArgs;
    }
}

export default Operator;